//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#ifndef PORT_KEEPER_HPP
#define PORT_KEEPER_HPP

#define MAX_PORTS		100     //AAS OLD Value 24
#define MAXLEN_PORT_NAME	14      // OS_WINCE fix: extended from 7, to fix 158803

const TCHAR c_szCOM1Identifier[] = _T("COM1:");
const TCHAR c_szLPTIdentifier[] = _T("LPT1:");
const TCHAR c_szPRNIdentifier[] = _T("PRN");

class CPortKeeper
{
public:
	CPortKeeper();
	~CPortKeeper();

	int GetNoPorts();
	BOOL AcceptPortName (LPCTSTR szPort);
	LPCTSTR GetPort (int n);
	BOOL GetPrinterPorts();

private:
#ifndef UNDER_CE
	DWORD EnumDevices2(LPTSTR DevList, LPDWORD lpBuflen);
#endif
	
	// list of printer ports
	TCHAR *m_szPortList[MAX_PORTS];
	int m_nPorts;
};

#endif
